package com.example.tangjiangxu.lifecycle.launchmode;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.example.tangjiangxu.lifecycle.R;

public class LaunchModeActivity extends Activity {
    private final static String TAG = "LaunchModeActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_launchmode);
        findViewById(R.id.btn_applicationcontext_startactivity).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(LaunchModeActivity.this, StandardActivity.class);
                LaunchModeActivity.this.getApplicationContext().startActivity(intent);
            }
        });

        findViewById(R.id.btn_singletop).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(LaunchModeActivity.this, SingleTopActivity.class);
                startActivity(intent);
            }
        });
        findViewById(R.id.btn_singletask).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(LaunchModeActivity.this, SingleTaskActivity.class);
                startActivity(intent);
            }
        });

        findViewById(R.id.btn_singleinstance).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(LaunchModeActivity.this, SingleInstanceActivity.class);
                startActivity(intent);
            }
        });
    }
}
